package com.learn.kotlinlearndemolist.model

import android.util.Log

open class Person {
    private val TAG = "Person"
    var age = 0
    var name = ""

    constructor()

    constructor(age: Int, name: String) {
        this.age = age
        this.name = name
    }


    fun eat() {
        Log.d(TAG, "eat: name = $name  is age = $age")
    }

    override fun toString(): String {
        return "Person(TAG='$TAG', age=$age, name='$name')"
    }

    companion object {
        private const val TAG = "Person"

        @JvmStatic //这样Java中也可以直接调用
        fun testObject(){
            Log.d(TAG, "testObject: ")
        }
    }
}